import { resolve } from 'path'
import { defineConfig, externalizeDepsPlugin } from 'electron-vite'
import vue from '@vitejs/plugin-vue'
import svgLoader from 'vite-svg-loader'
export default defineConfig({
  main: {
    plugins: [externalizeDepsPlugin()],
    resolve:{
      alias:{
        '@common': resolve('src/common'),
        '@': resolve('src/'),
      }
    },
    publicDir: resolve('config'),
    build: {
      rollupOptions: {
        output: {
          format: 'es'
        }
      }
    }
  },
  preload: {
    plugins: [externalizeDepsPlugin()],
    resolve:{
      alias:{
        '@common': resolve('src/common'),
        '@': resolve('src/'),
      }
    },
    build: {
      rollupOptions: {
        output: {
          format: 'es'
        }
      }
    }
  },
  renderer: {
    resolve: {
      alias: {
        '@common': resolve('src/common'),
        '@renderer': resolve('src/renderer/src'),
        '@resource': resolve('resources'),
      }
    },
    plugins: [vue(),svgLoader()]
  }
})
